/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.cognition.util.marshal;

import java.io.ByteArrayOutputStream;

/**
 * Allows reading and writing of java primitives to the underlying
 * byte array.
 *
 * @author richard
 */
public class JavaPrimitiveOutputStream extends ByteArrayOutputStream{

    public JavaPrimitiveOutputStream(){
        super();
    }

    public JavaPrimitiveOutputStream(int size){
        super(size);
    }

    public void write(int i){
        throw new UnsupportedOperationException(
            "You must use marshal operations to write data to this stream.");

    }

    public void write(byte[] b){
        throw new UnsupportedOperationException(
            "You must use marshal operations to write data to this stream.");

    }

    public void write(byte[] b, int off, int len){
        throw new UnsupportedOperationException(
            "You must use marshal operations to write data to this stream.");

    }
    public void marshal(byte b){}
    public void marshal(byte[] b){}

    public void marshal(int b){}
    public void marshal(int[] b){}

    public void marshal(short b){}
    public void marshal(short[] b){}

    public void marshal(float b){}
    public void marshal(float[] b){}

    public void marshal(double b){}
    public void marshal(double[] b){}

    public void marshal(char b){}
    public void marshal(char[] b){}

    public void marshal(long b){}
    public void marshal(long[] b){}

    public void marshal(boolean b){}
    public void marshal(boolean[] b){}

    public void marshal(String s){}
    public void marshal(String[] s){}
}
